/**
 * 项目名：五位一体化工安全信息平台
 * 日期：    2019-12-10 08:35:30
 * Copyright (c) 2015- joysuch-版权所有
 */

package com.joysuch.wwyt.bp.entity;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

import static javax.persistence.GenerationType.IDENTITY;

@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Entity
@Table(name = "wwyt_bp_work_safety_cert_method")
public class BpWorkSafetyCertMethod implements java.io.Serializable {

    //columns START
    //ID
    private Long id;
    //作业ID
    private Long workId;
    //措施
    private String method;
    //确认人
    private Long confirmUserId;
    //租户ID
    private Long tenentId;
    //组织机构代码
    private String orgCode;
    //columns END
    //确认人证书
    private String confirmUserCertIdJson;

    //人员是否是公司人员还是承包商json(0公司,1承包商)
    private Integer confirmUserType;

    //措施确认状态:0已确认;1不涉及;2不符合
    private Integer state;
    //签名id
    private Long singerId;


    @Column(name = "confirm_user_type")
    public Integer getConfirmUserType() {
        return confirmUserType;
    }

    public void setConfirmUserType(Integer confirmUserType) {
        this.confirmUserType = confirmUserType;
    }

    @Column(name = "singer_id")
    public Long getSingerId() {
        return singerId;
    }

    public void setSingerId(Long singerId) {
        this.singerId = singerId;
    }

    @Column(name = "state")
    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getConfirmUserCertIdJson() {
        return confirmUserCertIdJson;
    }

    public void setConfirmUserCertIdJson(String confirmUserCertIdJson) {
        this.confirmUserCertIdJson = confirmUserCertIdJson;
    }

    public void setId(Long value) {
        this.id = value;
    }

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "Id", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }


    @Column(name = "WORK_ID")
    public Long getWorkId() {
        return this.workId;
    }

    public void setWorkId(Long value) {
        this.workId = value;
    }


    @Column(name = "METHOD", length = 300)
    public String getMethod() {
        return this.method;
    }

    public void setMethod(String value) {
        this.method = value;
    }


    @Column(name = "CONFIRM_USER_ID")
    public Long getConfirmUserId() {
        return this.confirmUserId;
    }

    public void setConfirmUserId(Long value) {
        this.confirmUserId = value;
    }


    @Column(name = "TENENT_ID")
    public Long getTenentId() {
        return this.tenentId;
    }

    public void setTenentId(Long value) {
        this.tenentId = value;
    }


    @Column(name = "ORG_CODE", length = 100)
    public String getOrgCode() {
        return this.orgCode;
    }

    public void setOrgCode(String value) {
        this.orgCode = value;
    }


    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("workId", getWorkId())
                .append("method", getMethod())
                .append("confirmUserId", getConfirmUserId())
                .append("state", getState())
                .append("tenentId", getTenentId())
                .append("orgCode", getOrgCode())
                .toString();
    }

    public int hashCode() {
        return new HashCodeBuilder()
                .append(getId())
                .toHashCode();
    }

    public boolean equals(Object obj) {
        if (obj instanceof BpWorkSafetyCertMethod == false) return false;
        if (this == obj) return true;
        BpWorkSafetyCertMethod other = (BpWorkSafetyCertMethod) obj;
        return new EqualsBuilder()
                .append(getId(), other.getId())
                .isEquals();
    }
}

